package com.fenghen.demo01.controller;

import com.fenghen.demo01.service.LogExecutionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogExecutionController {

    /**
     * 构造器注入
     */
//    private final LogExecutionService logExecutionService;
//
//    public LogExecutionController(LogExecutionService logExecutionService) {
//        this.logExecutionService = logExecutionService;
//    }

    /**
     * Setter 注入
     */
//    private LogExecutionService logExecutionService;
//
//    @Autowired
//    public void setLogExecutionService(LogExecutionService logExecutionService) {
//        this.logExecutionService = logExecutionService;
//    }

    @Autowired
    private LogExecutionService logExecutionService;

    @GetMapping("/test")
    public String test() throws InterruptedException {
        logExecutionService.test();
        return "ok";
    }


}
